package com.tarry.socket.http;

import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.Map;

@Slf4j
public class HutoolHttpForward {

    public static void main(String[] args) {

        Map<String, Object> param = new HashMap<>();

        param.put("code", "11111111111111111");
        param.put("name", "tarry");

        String jsonStr = JSONUtil.toJsonStr(param);

        log.info("jsonStr: {}", jsonStr);

        String post = HttpUtil.post("http://localhost:9080/customer/query", jsonStr);
        log.info("post result: {}", post);

    }
}
